{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "根据体重和身高计算BMI"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "您的BMI指数为：25.95\n",
      "您的体重偏高\n"
     ]
    }
   ],
   "source": [
    "weight = input('请输入体重（kg）：')\n",
    "height = input('请输入身高（m）：')\n",
    "BMI = float(weight) / (float(height) ** 2)\n",
    "print('您的BMI指数为：%.2f' % BMI)\n",
    "if BMI < 18.5:\n",
    "    print('您的体重太轻了')\n",
    "elif BMI < 24.9:\n",
    "    print('您的体重很完美')\n",
    "elif BMI < 29.9:\n",
    "    print('您的体重偏高')\n",
    "else:\n",
    "    print('您的体重太胖了')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
